<%-- 
    Document   : Employee
    Created on : May 9, 2012, 9:28:43 AM
    Author     : Thanh Luan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <link rel="stylesheet" type="text/css" href="../scripts/tabs/slidingtabs-horizontal.css">
        <script type="text/javascript" src="../scripts/tabs/slidetab.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <link rel="stylesheet" type="text/css" href="../css/dropdown.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript">
            $j(document).ready(function() {
                initThickBox('.thickbox');
                  $j('.text_search').live('keyup',function(){
                    if($j('.text_search').val() == ""){
                        $j('.noteRow').show();
                        $j('.close').trigger('click');   
                                   
                    }else{
                        $j('.close').trigger('click');   
                        $j('.noteRow').hide();
                        $j('.noteRow').each(function(){
                            html = $j(this).html();                            
                            if(ununicode(html).indexOf(ununicode($j('.text_search').val())) > -1)  {                                
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
                $j(".department2").live("click", function() {

                    fh200 = $j(".donvi").attr("lang");
                    fn850 = $j(this).attr("lang");
                    fn450 = $j(".department1").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    //   showPleaseWait(); 
                    $j.post("N450_N850.jsp?&action=group&fh200=" + fh200 + "&fn450=" + fn450 + "&fn850=" + fn850, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                            //       hidePleaseWait();        
                        }
                    });
                });
                $j('.loadproject').live('click', function() {
                    fis = $j(this).attr('lang');
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    showPleaseWait();
                    window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                });
                $j(".department3").live("click", function() {
                    fh200 = $j(".donvi").attr("lang");
                    fn850 = $j(this).attr("lang");
                    fn450 = $j(".department1").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    $j.post("N450_N850.jsp?&action=group&fh200=" + fh200 + "&fn450=" + fn450 + "&fn850=" + fn850, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                        }
                    });
                });
                $j(".cbx_editEmp").live("change", function() {
                    fn850 = $j(".department2").attr("lang");
                    emp = $j('.cbx_editEmp').children("option:selected").val();
                    fis = $j('.fis').attr('lang');
                    showPleaseWait();
                    $j.post("N450_N850.jsp?fn850=" + fn850 + "&emp=" + emp, function(data) {
                        if (data != null) {
                            window.location.href = "project.jsp?action=loadproject&fis=" + fis;
                            hidePleaseWait();
                        }
                    });
                });
                $j('.text_search').live('keyup', function() {
                    if ($j('.text_search').val() == "") {
                        $j('.noteRow').show();
                        $j('.close').trigger('click');

                    } else {
                        $j('.close').trigger('click');
                        $j('.noteRow').hide();
                        $j('.noteRow').each(function() {
                            html = $j(this).html();
                            if (ununicode(html).indexOf(ununicode($j('.text_search').val())) > -1) {
                                $j(this).show();
                            } else {
                                $j(this).hide();
                            }
                        });
                    }

                });
                $j('.icondots').live('hover', function() {
                    $j(this).next('.addgroup').css('display', 'block');
                    $j(this).next('.addgroup').css('z-index', '999');
                });
                $j('.icondots').live('mouseout', function() {
                    $j(this).next('.addgroup').css('display', 'none');
                });
                $j('.search_boxp').hide();
                $j('.sidebar_search').live('click', function() {
                    $j('.search_boxp').hide();
                    if ($j(this).next().hasClass('active')) {

                        $j('.search_boxp').removeClass('active');
                    } else {

                        $j('.search_boxp').removeClass('active');
                        $j(this).next().addClass('active');
                        $j(this).next().show();
                    }
                });
            });
        </script>

    </head>
    <body>
        <div id="content">
            <a4j:form>
                
                <div id="menutop_top">
                     <div class="div_search_menutop">
                        <div class="item_search">

                            <h:inputText onfocus="if(this.value=='search') this.value='';" style="float:left;" styleClass="text_search" value="#{customerExpand.keySearch}"/>
                            <div style="float:left;border-top: 1px solid #55ACDB;border-bottom: 1px solid #55ACDB;" class="img_search"> <h:graphicImage style="float:left;" value="../images1/arrow_down.png"/></div>
                            <div style="float:left;border: 1px solid #55ACDB;"> <h:graphicImage styleClass="find_all_emp" style="float:left;" value="../images1/btn_search.png"/></div>
                        </div>
                        <div class="form_search_header">
                            <div class="item_search "><h:outputText value="x" styleClass="close_search" style="font-weight:bold;float:right;margin-right:2.2%;"/></div>
                            <div class="item_search">
                                <table id="table_search">
                                    <tr>
                                        <td class="celltable">
                                            <h:selectOneRadio styleClass="css_radio" value="#{customerExpand.typesearch}">
                                                <f:selectItem itemValue="1" itemLabel="Công ty" />

                                                <f:selectItem itemValue="2" itemLabel="Phone" />
                                                <f:selectItem itemValue="3" itemLabel="Họ tên" />
                                                <f:selectItem itemValue="4" itemLabel="CMND/PP" />
                                                <f:selectItem itemValue="5" itemLabel="Email" />
                                                <f:selectItem itemValue="6" itemLabel="Tour" />
                                                <f:selectItem itemValue="7" itemLabel="MSKH" />
                                            </h:selectOneRadio>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td class="celltable">
                                            <h:commandButton      action="#{customerExpand.reload}" value="#{locale.search}" styleClass="buttonsearch">
                                            </h:commandButton>
                                        </td>

                                    </tr>
                                </table>

                            </div>
                        </div>
                    </div>
                    <%--Chua run dc action --%>
                    <%--
                    <div class="icon_action">
                        <h:inputHidden value="#{B630Bean.loginEmp}"/> 
                            <a4j:region>
                                <h:selectOneMenu  value="#{B630Bean.loginEmp}" styleClass="cbx_editEmp" id="ckb_098">
                                    <f:selectItems value="#{B630Bean.lstEmpByID}" />
                                    <a4j:support event="onchange"  reRender="list630"  actionListener="#{B630Bean.reloadlist}" onsubmit="showPleaseWait();" oncomplete="hidePleaseWait();" > 

                                    </a4j:support>
                                </h:selectOneMenu>
                            </a4j:region>
                        
                    </div>
                    
                    <div class="icon_action">
                        <h:outputLabel style="color:#fff;float:left;" rendered="#{B630Bean.actionChange =='birthday'}" > 
                            <img src="../images/viewSMS.png" class="displaySMS" style="cursor: pointer;" title="Xác nhận  SMS"/>
                        </h:outputLabel>
                        <h:outputLabel styleClass="lst_cus_birthday" id="btnsms" rendered="#{B630Bean.actionChange !='birthday'}" >
                            <img src="../images/icon_sms1.png" alt="Gửi SMS khách hàng có ngày sinh nhật" title="Gửi SMS khách hàng có ngày sinh nhật"/>
                        </h:outputLabel>
                    </div>
                    --%>
                    <div class="icon_action">
                        <h:outputLink style="color:#fff;"   value="popUpSendEmail.jsp?page=workChargeCM&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  >
                            <img src="../images/icon_email1.png" alt="Email" title="Gửi email"/>
                        </h:outputLink>     
                    </div>
                    <div class="icon_action">
                        <h:outputLink style="color:#fff;"   value="#" styleClass=""  >
                            <img src="../images/searchnew.png" alt="search" title="Tìm kiếm"/>
                        </h:outputLink> 
                    </div>

                </div>

                <div id="menutop">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#">
                                    <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                        <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                        <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/>
                                    </span>
                                </a>

                            </div>
                            <div class="select_hidden departmentlistN850">

                                <ul>
                                    <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                                <h:outputText value="Tất cả"/>
                                            </span></a></li>                          


                                    <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                        <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                    <h:outputText value="#{item.label}"/>
                                                </span></a></li> 
                                            </a4j:repeat>
                                </ul>
                            </div>
                        </div>
                    </h:panelGroup>
                </div>
                <div style="width: 100%;overflow: auto;height: 65%;">
                    <div style="width: 200%;">
                        <div class="headerdivtable">
                            <div class="itemheaderdivtable_center" style="width: 2%;">
                                <h:selectBooleanCheckbox styleClass="checkAll" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 4%;">
                                <h:outputText value="ACTION" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 3%;">
                                <h:outputText value="HOÀN THÀNH" escape="false"/>
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 6%;">
                                <h:outputText value="TIÊU ĐỀ" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 9%;">
                                <h:outputText value="HẠN MỤC" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 10%;">
                                <h:outputText value="HỌ TÊN" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 4%;">
                                <h:outputText value="SỐ ĐIỆN THOẠI" />
                            </div>
                            <div  class="itemheaderdivtable_center" style="width: 8%;">
                                <h:outputText value="EMAIL" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 10%;">
                                <h:outputText value="CÔNG TY" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width: 9%;">
                                <h:outputText value="BẮT ĐẦU" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width:5%;">
                                <h:outputText value="KẾT THÚC" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width:13%;">
                                <h:outputText value="GHI CHÚ" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width:5%;">
                                <h:outputText value="NGƯỜI CHỊU TN" />
                            </div>
                            <div class="itemheaderdivtable_center" style="width:9.4%;">
                                <h:outputText value="NGƯỜI CẬP NHẬT" />
                            </div>
                        </div>

                        <div class="headerdivtable_over">
                            <a4j:repeat  value="#{B630Bean.listAllN630}" var="item" id="table8" rowKeyVar="index" >    
                                <div class="noteRow headerdivtable_bootom <h:outputText rendered="#{index%2 !=0}"  value="headerdivtable_tr"/>">
                                    <div class="itemheaderdivtable_center " style="width: 2%;">
                                        <h:selectBooleanCheckbox styleClass="check_select" lang="#{item.pb630}"  />
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 4%;">
                                        <h:outputLink  rendered="#{loginSession.right.CMA_LST_MOD}"  value="workChargeInput.jsp?action=edit&page=workChargeCM.jsp&pb630=#{item.pb630}&fq100=#{B630Bean.fq100}&height=300px&width=500px" styleClass="fancybox">
                                            <img src="../images/edit.png" alt="edit" title="edit"/>
                                        </h:outputLink>
                                        <h:outputLink  rendered="#{loginSession.right.CMA_LST_DEL}"  value="deleteB630.jsp?action=delete&page=#{B630Bean.pageRidiect}&fq100=#{item.fq100}&itemid=#{item.fk100}&fb670=#{item.fb670}&pb630=#{item.pb630}&height=150px&width=300px" styleClass="fancybox">
                                            <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                        </h:outputLink>
                                        <h:outputLink rendered="#{loginSession.right.CMA_LST_DES}" value="noteWorkChargeInput.jsp?action=addNote&page=workChargeCM.jsp&pb630=#{item.pb630}&title=#{item.bv631} - #{item.hoten}&height=300px&width=500px" styleClass="fancybox" style="margin-left:3px;">
                                            <img  alt="Thêm ghi chú" src="../images/qb_email_add.png" width="15px" height="15px">
                                        </h:outputLink>

                                        <h:graphicImage rendered="#{loginSession.right.CMA_LST_VDE}" value="../images/history.png" height="15px" width="15px" alt="Ghi chú" title="Ghi chú" styleClass="showNote" lang="#{item.pb630}">                                                            
                                        </h:graphicImage>
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 3%;">
                                        <h:panelGroup rendered="#{loginSession.right.CMA_LST_CHE && item.bv638 =='A' }">
                                            <h:selectBooleanCheckbox value="#{B630Bean.checkComplete}" lang="#{item.pb630}" styleClass="checkComplete" style="float:left;"/>
                                        </h:panelGroup>
                                        <h:outputText rendered="#{item.bv638 == 'T'}" value="HT" style="text-align: center; width:100%;float: left;"></h:outputText>
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 6%;">
                                        <h:outputLink value="workChargeCM.jsp?page=customer.jsp">
                                            <h:outputText value="#{item.bv631}"  escape="false"/>
                                        </h:outputLink>
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 9%;">
                                        <div><h:outputText value="#{item.bv671}"  escape="false"/></div>
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 10%;">
                                        <div>
                                            <a href='customer.jsp?action=linkCus&pnPN100=<h:outputText value="#{item.fq100}"/>&type=<h:outputText value="#{item.nn104}"/>'>  <h:outputText value="#{item.hoten}"></h:outputText></a> 
                                        </div>
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 4%;">
                                        <h:outputText style="padding-left:1px" value="#{item.nv108}" styleClass="sendSMS_person phone" lang="page=workChargeCM.jsp&group=1&hoten=#{item.hoten}&phone=#{item.nv108}&fn100=#{item.fq100}"/>

                                    </div>
                                    <div  class="itemheaderdivtable_left" style="width: 8%;">
                                        <div> <h:outputLink style="padding-left:1px" value="popupSendMailPerson.jsp?page=workChargeCM&idx=#{item.fq100}&mailx=#{item.nv105}&typex=workChargeCM&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  ><h:outputText value="#{item.nv105}" /></h:outputLink>
                                        </div>
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 10%;">
                                        <div><h:outputText style="padding-left:1px" value="#{item.kv103}"></h:outputText></div>
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 9%;">
                                        <div><h:outputText style="padding-left:1px" value="#{item.bd632}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                        </div>
                                    </div>
                                    <div class="itemheaderdivtable_center " style="width: 5%;">
                                        <div><h:outputText style="padding-left:1px" value="#{item.bd633}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                        </div>
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 13%;">
                                        <div><h:outputText style="padding-left:1px" value="#{item.bv635}"></h:outputText></div>
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 5%;">
                                        <h:outputText style="padding-left:1px" value="#{item.nv106}"></h:outputText>

                                    </div>
                                    <div class="itemheaderdivtable_left " style="width: 9.4%;">
                                        <h:outputText style="padding-left:1px" value="#{item.bl648} "><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText><h:outputText value="<br/>(#{item.bl649})" escape="false"></h:outputText>

                                    </div>

                                </div>
                            </a4j:repeat>
                        </div>
                    </div>
                            
                </div>
                <div class="fotter-page" style="float: right">
                    <jsp:include page="../../common/pagingM650.jsp"/>
                </div>
                <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                 height="30" width="40" zindex="2000">
                    <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                </rich:modalPanel>
                <rich:modalPanel styleClass="pleaseimage" id="statPane" autosized="true" minHeight="10" minWidth="80"
                                 height="10" width="80" zindex="2000">
                    <h:graphicImage value="/images/loadingAnimation.gif" alt="ai" />
                </rich:modalPanel>
            </a4j:form>
        </div>

    </body>
</html>
